package lx.springBoot.controller;

import common.Result;
import lx.springBoot.activeMq.Producer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by lx on 2017/7/10.
 */
@RestController
@RequestMapping("/test")
public class TestController {
    @Autowired
    private Producer producer;


    @RequestMapping("/sendMq")
    public @ResponseBody Result<String> sendMQ(String mes){
        producer.sendTopic(mes);
        return Result.sucess(mes);
    }

    @RequestMapping("/a")
    public @ResponseBody Result sendMQ(){
        return Result.sucess("1");
    }
}
